package valueObjects
{
	import mx.collections.ArrayCollection;
	[Bindable]
	public class ShoppingCart
	{
		public function ShoppingCart()
		{
		}
		public function addProduct(product:Product):Boolean {
			var tempProd:Product;
			tempProd = product;
			products.addItem(tempProd);
			return true;
		}
		public function containsProduct(product:Product):Boolean {
			var tempProd:Product;
			for(var i:int = 0;i<products.length;i++){
				tempProd = products.getItemIndex(i) as Product;
				if(product.productId == tempProd.productId){
					return true;
				}
			}
			return false;
		}
		public function deleteProduct(index:int):void {
			products.removeItemAt(index);
		}
		public function updateProductNum(productId:String, productNum:int):Boolean{
			return false;
		}
		public var products:ArrayCollection = new ArrayCollection();;
		
	}
}